package net.yxsoft.bean.contract;
import lombok.Data;
import org.web3j.abi.datatypes.DynamicBytes;
import org.web3j.abi.datatypes.DynamicStruct;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint32;

import java.math.BigInteger;

@Data
public class EvidenceItem extends DynamicStruct {
    public byte[] name;

    public BigInteger createTM;

    public BigInteger evidenceType;

    public byte[] remark;

    public byte[] txHash;

    public EvidenceItem(DynamicBytes name, Uint256 createTM, Uint32 evidenceType,
                        DynamicBytes remark, Bytes32 txHash) {
        super(name,createTM,evidenceType,remark,txHash);
        this.name = name.getValue();
        this.createTM = createTM.getValue();
        this.evidenceType = evidenceType.getValue();
        this.remark = remark.getValue();
        this.txHash = txHash.getValue();
    }

    public EvidenceItem(byte[] name, BigInteger createTM, BigInteger evidenceType,
                        byte[] remark, byte[] txHash) {
        super(new DynamicBytes(name),new Uint256(createTM),new Uint32(evidenceType),new DynamicBytes(remark),new Bytes32(txHash));
        this.name = name;
        this.createTM = createTM;
        this.evidenceType = evidenceType;
        this.remark = remark;
        this.txHash = txHash;
    }

}